package com.youkeyi.ddy.cloud.common.api.application.system.server;

import com.youkeyi.ddy.cloud.common.api.application.system.server.dto.SystemServerListCloudDto;
import com.youkeyi.ddy.cloud.common.api.application.system.server.param.*;
import com.youkeyi.ddy.cloud.common.response.ResponseContent;
import io.swagger.annotations.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 系统服务
 *
 * @Serveror liuxiawang
 * @Date 5/24/22 10:36 PM
 * @Location shenzhen.china
 */
@Api(tags = {"【SYSTEM】server management"})
@RestController
@FeignClient(value = "YOUKEYI-DDY-CLOUD-APPLICATION-SYSTEM", fallback = SystemServerCloudServiceFallback.class)
@RequestMapping("/system/server")
public interface SystemServerCloudService {

    // 查询服务列表
    @ApiOperation(value = "Query System Server List", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.system.server.SystemServerCloudService.list")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = SystemServerListCloudDto.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Query System Server List", dataType = "SystemServerListCloudParam", dataTypeClass = SystemServerListCloudParam.class),
    })
    @GetMapping
    public abstract SystemServerListCloudDto list(SystemServerListCloudParam param);

    // 创建服务
    @ApiOperation(value = "Create System Corp", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.system.server.SystemServerCloudService.create")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "body", value = "Param of Create System Corp", dataType = "SystemServerCreateCloudParam", dataTypeClass = SystemServerCreateCloudParam.class),
    })
    @PostMapping("/create")
    public abstract ResponseContent create(@RequestBody SystemServerCreateCloudParam param);


    // 编辑服务
    @ApiOperation(value = "Update System Corp", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.system.server.SystemServerCloudService.update")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "body", value = "Param of Update System Corp", dataType = "SystemServerUpdateCloudParam", dataTypeClass = SystemServerUpdateCloudParam.class),
    })
    @PatchMapping("update")
    public abstract ResponseContent update(@RequestBody SystemServerUpdateCloudParam param);


    // 删除服务
    @ApiOperation(value = "Delete System Corp", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.system.server.SystemServerCloudService.delete")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Delete System Corp", dataType = "SystemServerDeleteCloudParam", dataTypeClass = SystemServerDeleteCloudParam.class),
    })
    @DeleteMapping("/delete")
    public abstract ResponseContent delete(SystemServerDeleteCloudParam param);

}
